<?php
if($modelObj->{fieldName}) {
    ?>
    <div class="form-group">
        <div class="label">
            <label>原{fieldDesc}</label>
        </div>
        <div class="field">
            <img style="background-color: gray;"  src="<?php  if(!preg_match("/^http/i",$modelObj->{fieldName})) echo FRONT_URL; echo $modelObj->{fieldName}; ?>" width="200px"/>
            <div class="tips"></div>
        </div>
    </div>
    <?php
}
				?>
<div class="form-group">
    <div class="label">
        <label>{fieldDesc}</label>
    </div>
    <div class="field"><img style="background-color: gray;" width="200px" src="" id="p{fieldName}"><input type="hidden" name="{fieldName}" id="{fieldName}"  value="<?php echo $modelObj->{fieldName}; ?>">
        <a href="javascript:;" id="c{fieldName}" class="UploadImg" style="clear: left; color: #fff">+ {fieldDesc}上传
        </a>
        <div class="tipss"></div>
    </div>
</div>
<script>
    // 依次指定 点击选择图片的元素、<input type=file> 和 回调函数
    zUploadImg({
        clicker : '#c{fieldName}',
    imgPos : '#p{fieldName}',
    size : 1,
        uploadUrl : '/file,save',
    preImg : 'images/timg.jpg',
    otherData : {
        imagePos : '位置1',
    },
    imgKey : 'data',
    backImgKey : ['data','uploadImg'],
    baseUrl : '<?php echo FRONT_URL; ?>',
    callback : function(img){
        $("#p{fieldName}")[0].src = img;
        var url = img.replace(/<?php echo str_replace("/","\/",FRONT_URL); ?>/i,"");
        $("#{fieldName}").val(url);
    },
    randomStr : 'rand{fieldName}', // 随机字符串,保证每次调用不同
    });
</script>